package cn.hloger.spider.demo.chatgptDemo.config;

import cn.hloger.spider.demo.chatgptDemo.interceptor.ChatgptInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author huanglong
 * @version 1.0
 * @date 2024/2/1
 */
@Configuration(value = "chatgptDemoWebConfig")
public class ChatWebConfig implements WebMvcConfigurer {
    @Autowired
    private ChatgptInterceptor zhyReqInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(zhyReqInterceptor).addPathPatterns("/api/chat/**");
    }
}